<template>
	<view>		
	
		
		
		<view style="display: flex;flex-direction: row;">
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">收购单号：</text><text>{{data.purchaseNo}}</text></view>
		</view>
		<view style="display: flex;flex-direction: row;">
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">卖家姓名：</text><text>{{data.sellerName}}</text></view>
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">联系方式：</text><text>{{data.sellerPhone}}</text></view>
		</view>
		
		<view style="display: flex;flex-direction: row;">
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">订单状态：</text><text>{{data.purchaseStatus}}</text></view>
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">收购金额：</text><text>{{data.totalAmount}}元</text></view>
		</view>
		<view style="display: flex;flex-direction: row;">
			<view style="flex: 1;margin-left: 30rpx;"><text style="font-weight: bold;">收购日期：</text><text>{{data.createTime}}</text></view>
		</view>
		<view style="margin-left: 25rpx;margin-top: 25rpx;font-size: 35rpx;">收购粮食信息</view>
		<u-line color="gray" />
		<uni-list>
			<uni-list-item v-for="item in data.purchaseRecordDetailList" :key="item.id" direction="column">
				<template v-slot:header>
					<view>粮食名称：<text>{{item.grainName}}</text></view>
				</template>
				<template v-slot:body>
					<view style="margin: 15rpx 0rpx;">
						<view><text style="font-weight: bold;">毛重：</text><text>{{item.roughWeight}}kg</text></view>
						<view><text style="font-weight: bold;">皮重：</text><text>{{item.tareWeight}}kg</text></view>
						<view><text style="font-weight: bold;">净重：</text><text>{{item.suttleWeight}}kg</text></view>
						<view><text style="font-weight: bold;">单价：</text><text>{{item.unitPrice}}元</text></view>
						<view><text style="font-weight: bold;">总金额：</text><text>{{item.amount}}元</text></view>
					</view>
				</template>
				<!-- <template v-slot:footer>
					<view style="text-align: right;">
						<u-button type="default" size="mini" style="margin-left: 10rpx;" @click="gotoDetail(item.id)">查看</u-button>
						<u-button type="primary" size="mini" style="margin-left: 10rpx;">编辑</u-button>
						<u-button v-if="item.purchaseStatus == 1" type="primary" size="mini" style="margin-left: 10rpx;">生成票据</u-button>
					</view>
				</template> -->
			</uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	
	import {
		getPurchaseRecord
	} from "@/api/oms/purchaseRecord.js";
	export default {
		data() {
			return {
				data:null
			}
		},
		onLoad(params) {
			getPurchaseRecord(params.id).then(res=>{
				if(res.code == 200){
					this.data = res.data;
					console.log(this.data);
				}
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
